﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class InformaciondeCarga : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            string salida = "";
           /*XDocument miXML = new XDocument(
           new XDeclaration("1.0", "ISO-8859-1", "yes"),
            new XComment("Lista de Alumnos"),
            new XElement("Alumnos",
                                new XElement("Alumno",
                                    new XAttribute("NoControl", "05231104"),
                                    new XElement("Nombre", "Edison García"),
                                    new XElement("Semestre", "7")),

                                 new XElement("Alumno",
  l                                  new XAttribute("NoControl", "05231106"),
                                    new XElement("Nombre", "Abraham Gomez García"),
                                    new XElement("Semestre", "9")),

                                new XElement("Alumno",
                                    new XAttribute("NoControl", "05231108"),
                                    new XElement("Nombre", "Alejandre Carvajal"),
                                    new XElement("Semestre", "7")),

                                new XElement("Alumno",
                                    new XAttribute("NoControl", "06231110"),
                                    new XElement("Nombre", "Luis Armando"),
                                    new XElement("Semestre", "10"))*/

            XDocument miXML = new XDocument(
                new XDeclaration("1.0","ISO-8859-1",null),
      #region root
         new XElement("root",
            #region acceso
                new XElement("acceso",
                        new XElement("username","clara13@270"),
                        new XElement("password", "cla1020736056")),
            #endregion

            #region solicitud
 new XElement("solicitud",
                    new XElement ("tipo","1"),
                    new XElement ("procesoid","1")),
            #endregion

            #region variables
 new XElement("variables",
                    new XElement("NUMNITEMPRESATRANSPORTE", "900301001"),
                    new XElement("CONSECUTIVOINFORMACIONCARGA", "0735"),
                    new XElement("CODOPERACIONTRANSPORTE", "G"),
                    new XElement("CODTIPOEMPAQUE", "6"),
                    new XElement("CODNATURALEZACARGA", "1"),
                    new XElement("DESCRIPCIONCORTAPRODUCTO", "ACEITE DE BACALAO"),
                    new XElement("MERCANCIAINFORMACIONCARGA", "001504"),
                    new XElement("CANTIDADINFORMACIONCARGA", "20000"),
                    new XElement("UNIDADMEDIDACAPACIDAD", "1"),
                    new XElement("CODTIPOIDREMITENTE", "N"),
                    new XElement("NUMIDREMITENTE", "9300476681"),
                    new XElement("CODSEDEREMITENTE", "2"),
                    new XElement("CODTIPOIDDESTINATARIO", "C"),
                    new XElement("NUMIDDESTINATARIO", "53468994"),
                    new XElement("PACTOTIEMPOCARGUE", "SI"),
                    new XElement("HORASPACTOCARGA", "2"),
                    new XElement("MINUTOSPACTOCARG", "10"),
                    new XElement("PACTOTIEMPODESCARGUE", "SI"),
                    new XElement("HORASPACTODESCARGUE", "2"),
                    new XElement("MINUTOSPACTODESCARGUE", "10")
        //            new XElement("OBSERVACIONES", "observaciones de recomendacion"),
        //    #region remesa
        //new XElement("REMESA",
        //            new XElement("procesoid", "43"),
        //            new XElement("REMESA",
        //            new XElement("CONSECUTIVOREMESA", "0001")),
        //            new XElement("REMESA",
        //            new XElement("CONSECUTIVOREMESA", "0020"))
        //    //este parèntesis cierra remesasman
        //            )
        //    #endregion
            //este parèntesis cierra variables
             )
            #endregion
  //este parèntesis cierra root
)
            #endregion
 // este parèntesis cierra documento xml
);
            salida = miXML.ToString();

            //string strXML = "";
            wsMintransporte.BPMServicesClient obj = new wsMintransporte.BPMServicesClient();
            string strSalida = obj.AtenderMensajeRNDC(salida);
        }
        catch (Exception ex)
        {
            string strDAtoSalida = ex.Message.ToString();
            //hrow;
        }
    }
}